/**
 * 
 */
package com.zed.app.push.handler;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.zed.common.push.PushMessageType;


/**
 * 任务工厂
 */
@Component("pushMessageFactory")
public class PushMessageHandlerFactory {

	@Resource(name = "testMessageHandler")
	private PushMessageHandler testMessageHandler;
	
	@Resource(name = "baseMessageHandler")
	private PushMessageHandler baseMessageHandler;

	public PushMessageHandler getHandler(int type) {
		PushMessageType taskMessageType = PushMessageType.getType(type);
		if (taskMessageType == null)
			return baseMessageHandler;
		
		switch (taskMessageType) {
		case TEST:
			return testMessageHandler;
		default:
			return baseMessageHandler;
		}
		

	}


}
